package cn.tianyigps.m7.beans;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * Created with IDEA
 *
 * @description: 指令回复枚举
 * @author: cui.guibin
 * @create: 2019/4/15 16:16
 **/
@Getter
@Setter
@ToString
public class ReplyDTO {

//    RESTART_SUCCESS(200,true, "重启成功"),
//    RESTART_FAILURE(200,true, "重启失败"),
//
//    ONLINE_FAILURE(404,false, "设备不在线！"),
//
//    PLATFORM_SUCCESS(200,true, "转平台成功"),
//    PLATFORM_FAILURE(404,true, "转平台成功"),
//
//    CUT_OIL_ELE_SUCCESS(200,true, "操作成功"),
//    CUT_OIL_ELE_FAILURE(404,true, "断油电失败！，ACC 开启时，GPS 没有定位或者速度大于 20KM/H, 断油操作延后!"),
//    CUT_ALREADY(400,true, "断油电失败！ 已经处于断油电状态!"),
//
//    RESTORE_OIL_ELE_SUCCESS(200,true, "Cut off the fuel supply: Success!Speed:0 km/h. "),
//    REPLY_FAILURE(104,true, "指令错误"),
//    PARAM_FAILURE(103,true, "指令参数错误"),
//    RESTORE_OIL_ELE_FAILURE(400,false, "恢复油电失败！已经处于油电恢复状态！");

    private int code;
    private String equipmentId;
    private Boolean success;
    private String msg;

    public ReplyDTO(String equipmentId, int code, Boolean success, String msg) {
        this.equipmentId= equipmentId;
        this.code= code;
        this.msg = msg;
        this.success=success;
    }
    public ReplyDTO() {
    }
    public ReplyDTO(String replyString) {

        switch (replyString){
            case "RELAY,ERROR:104":
                break;
            case "RELAY,ERROR:103":
                break;
            case "RELAY,FAIL! ACC ON, GPS has Not FIXED or speed > 20KM/H, relay delay!!":
                break;
            case "RELAY,The oil has been cut already !!":
                break;
            case "RELAY,The oil has been Resume already !!":
                break;
            case "Cut off the fuel supply: Success!Speed:0 km/h.":
                break;
            case "Restore fuel supply:Success!":
                break;
            case "RELAY,Restore fuel supply:Success! ":
                break;
                default:
        }
        this.msg = msg;
    }


}
